package com.cn.mapper.user;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cn.entity.Message;
import com.cn.entity.User;
import com.cn.vo.userVo.Friend;
import com.cn.vo.userVo.Request;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * 创建好友申请列表
     * @param tableName
     * @return
     */
    public int creatFriendRequestTable(@Param("tableName") String tableName);
    /**
     * 创建好友列表
     * @return
     */
    public int creatFriendTable(@Param("tableName") String tableName);


    /**
     * 创建作品表
     * @return
     */
    public int creatWorksTable(@Param("tableName") String tableName);
    /**
     * 创建收藏表
     */
    public int creatCollectionTable(@Param("tableName") String tableName);


    public  void updateUser(User user);
    public void accountSuspended(String userName);

    public void cancelSuspended(String userName);
    public List<User> isSuspended(String userName);

     public  void sendBeFriendRequest(@Param("request_id") int request_id, @Param("receive_id")int receive_id);//发出好友请求

    public  void beFriendForReceive(@Param("request_admin") String request_admin, @Param("request_name")String request_name, @Param("receive_admin")String receive_admin, @Param("receive_name")String receive_name);//成为接收者的好友
    public  void beFriendForRequest(@Param("request_admin") String request_admin, @Param("request_name")String request_name,@Param("receive_admin")String receive_admin, @Param("receive_name")String receive_name);//成功发送者的好友


    public void sendMassageById(@Param("sender_admin") int senderAdmin, @Param("receiver_admin") int receiverId,@Param(("message")) String Message );//发送一条消息
    public List<Message> flexibleQueryMessage(@Param("message") String message);
    public List<User> flexibleQueryUser(@Param("query") String query);
    public List<Friend> showFriend(@Param("user_name") String user_name);//查看好友列表

    public void deleteFriendByAdmin(@Param("user_name") String user_name, @Param("friend_username") String friend_username);
    public void deleteFriendByAdmin2(@Param("user_name") String user_name, @Param("friend_username") String friend_username);

    public List<Request> showRequest(@Param("receive_admin") String receive_admin);

    public void sendRequest(@Param("request_admin") String request_admin, @Param("request_name")String request_name,@Param("receive_admin")String receive_admin, @Param("receive_name")String receive_name);

    public  void deleteRequst(@Param("receive_admin") String receive_admin,@Param("request_admin") String request_admin);

}

